public class ConditionedGraph extends Graph
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<Condition> |
conditions
The List of Conditions applied to this Graph.
|
private boolean |
forceSatisfactionOnAdd
A boolean indicating whether or not conditions are forced when
components are added to the network.
|
suppressLog| Modifier | Constructor and Description |
|---|---|
private |
ConditionedGraph(Graph graph,
java.util.Collection<Condition> conditions)
Private constructor used to create copies of ConditionedGraph objects.
|
|
ConditionedGraph(java.lang.String graphName)
Public constructor for creating a simple ConditionedGraph.
|
|
ConditionedGraph(java.lang.String graphName,
java.util.Collection<Condition> conditions)
Public constructor for creating a ConditionedGraph.
|
|
ConditionedGraph(java.lang.String graphName,
java.util.Collection<Condition> conditions,
boolean forceOnAdd)
Public constructor for creating a ConditionedGraph.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCondition(Condition condition)
Adds a condition to the graph.
|
boolean |
addPartialGraph(java.util.List<Node> nodes,
java.util.List<Edge> edges)
Adds a partial graph to this graph.
|
private ConditionedGraph |
conditionOther(Graph graph)
Private method used for copying the ConditionedGraph.
|
ConditionedGraph |
copy()
Copies this Graph object using the getSubGraph() method.
|
boolean |
forcesOnAdd()
Returns true if conditions are forced on addition of new network
components.
|
java.util.List<Condition> |
getConditionsList()
Returns an accessible list of conditions.
|
boolean |
querySatisfaction()
Used to query if the ConditionedGraph fits its applied conditions.
|
void |
removeCondition(Condition condition)
Removes a condition from the graph.
|
void |
setForceOnAdd(boolean forceSatisfactionOnAdd)
Accessor method for configuring if conditions are forced on add of
network components.
|
private void |
superAddPartialGraph(java.util.List<Node> nodes,
java.util.List<Edge> edges)
Private method for circumventing the condition restrictions.
|
ConditionedGraph |
uniqueCopy()
Copies this Graph producing a unique copy in which there is no
entanglement between the two Graph objects.
|
addEdge, addEdge, addEdge, addEdges, addNewNode, addNode, addNodes, getAdjacencyList, getEdge, getEdge, getEdge, getEdgeList, getName, getNodeCount, getNodeIndex, getNodeIndex, getNodeList, getNodeName, getSubGraph, getSubGraph, getSubGraph, transpose, transpose, transposeprivate final java.util.List<Condition> conditions
private boolean forceSatisfactionOnAdd
public ConditionedGraph(java.lang.String graphName)
graphName - the String representing the name of the graph.public ConditionedGraph(java.lang.String graphName,
java.util.Collection<Condition> conditions)
graphName - the String representing the name of the graph.conditions - the Collection<Condition> containing the
Condition objects.public ConditionedGraph(java.lang.String graphName,
java.util.Collection<Condition> conditions,
boolean forceOnAdd)
graphName - the String representing the name of the graph.conditions - the Collection <Condition> containing the
Condition objects.forceOnAdd - the boolean indicating if conditions should be forced.public void addCondition(Condition condition)
condition - the Condition to add.public void removeCondition(Condition condition)
condition - the Condition to remove.public java.util.List<Condition> getConditionsList()
public boolean forcesOnAdd()
public void setForceOnAdd(boolean forceSatisfactionOnAdd)
forceSatisfactionOnAdd - a boolean indicating if conditions should
be forced.public boolean querySatisfaction()
public boolean addPartialGraph(java.util.List<Node> nodes, java.util.List<Edge> edges)
Runs a simulation if the ConditionedGraph is configured to check first that additions will be adhered to. Allows a user to incrementally build a graph and determine at which point the graph no longer abides by its conditions.
addPartialGraph in class Graphnodes - the List<Node> containing the nodes to add.edges - the List<Edge> containing the edges to add.private void superAddPartialGraph(java.util.List<Node> nodes, java.util.List<Edge> edges)
addPartialGraph(java.util.List, java.util.List) for simulating
a graph expansion.nodes - the List<Node> containing the nodes to add.edges - the List<Edge> containing the edges to add.private ConditionedGraph conditionOther(Graph graph)
graph - an unconditioned Graph object to apply conditions to.public ConditionedGraph copy()
public ConditionedGraph uniqueCopy()
x.getNodeList().get(0) != y.getNodeList().get(0) under any
circumstances. The Nodes and Edges may remain equivalent via the
equals() implementation. Further, Edge data shall remain entangled due
to implementation details.uniqueCopy in class Graph